import Vue from 'vue'
import App from './App.vue'
/*引入css*/
import './assets/css/basic.scss';

/*引入vue-resource*/
import VueResource from 'vue-resource';
Vue.use(VueResource);

//引入路由
import VueRouter from 'vue-router';
Vue.use(VueRouter);

//引入组件
import Home from './components/Home.vue';
import News from './components/News.vue';
import NewsCnt from './components/NewsCnt.vue';

//路由配置

const routes = [
  { path: '/home', component: Home },
  { path: '/news', component: News },
  { path: '/newscnt/:aid', component: NewsCnt },
  { path: '*', redirect: '/home' }//默认跳转路由
];

//实例化路由
const router = new VueRouter({
  routes // （缩写）相当于 routes: routes
});

new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
